import { Injectable } from '@angular/core';
import { HttpClient } from '../../../../providers/httpClient';
import { Config } from '../../../../providers/config';

@Injectable()
export class MarketingWeeklyListService {
	constructor(
		public httpClient: HttpClient,
		public config: Config
		) { }
	getListData(page, condition) {
		let postBody = {
			"module": "KSB",
			"method": "USP_A02_0080",
			"type":"USP",
			"params": {
				"startdate":condition.startdate.replace(/-/g, ""),
				"enddate":condition.enddate.replace(/-/g, ""),
				"usr_id":"",
				"author":condition.emp,
				"pageLines":this.config.pageSize,
				"currentPage":page
			}
		};
		console.log("#####工作周报列表查询条件######");
		console.log(postBody);
		return this.httpClient.post(postBody, {
			isShowLoading: true
		});
	}
	// 获取邮件详情
	getDetailData(id) {
		let postBody;
		postBody = {
			"module": "Email",
			"method": "getMailInfoByBosid",
			"params": {
				"mailbosid": id,
				"logid": "fengjk"
			}
		};
		return this.httpClient.post(postBody);
	}

  getAllAuthority() {
    let postBody = {
      "module": "KSB",
      "method": "USP_A02_0100",
      "type": "USP",
      "format": "json",
      "params": {
        "login_nm": ""
      }
    };

    return this.httpClient.post(postBody, {
      isShowLoading: true
    });
  }
}
